package com.ruoyi.project.tool;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

/**
 * @author heshuaijun
 * @date 2020/5/2518:10
 */
public class RandomUtil {

    public static String getRandomFileName() {
    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");

    Date date = new Date();

    String str = simpleDateFormat.format(date);

    Random random = new Random();

    int rannum = (int) (random.nextDouble() * (99999 - 10000 + 1)) + 10000;// 获取5位随机数

    return rannum + str;// 当前时间
        }


}
